/**
 * 
 */
package travibot.model;

import java.util.HashMap;
import java.util.Map;

/**
 * Basic wrapper for composite construction cost (either Structure or unit)
 * 
 * @author Petr Macek
 * 
 */
public class Cost {

    private Map<Material, Integer> materialCosts = new HashMap<Material, Integer>();

    public int getCost(Material mat) {

        return materialCosts.get(mat);
    }

    /**
     * Method adds cost of single material to the cost pool. Note that added
     * values should be immutable (thus adding new cost for already added
     * material does nothing)
     * 
     * @param mat
     * @param cost
     */
    public void addMaterialCost(Material mat, int cost) {

        if (!materialCosts.containsKey(mat)) {
            materialCosts.put(mat, cost);
        }
    }

}
